<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script  runat="server">
Dim subquerystring=""
Dim li=0
Dim myReader As SqlDataReader 
Dim myConn As SqlConnection
Sub Page_Load(ByVal sender As Object, _
	ByVal e As EventArgs)
	Dim strSQL="select top 20 * from vwItemTop100s "
	strSQL +="where ItemID>0" 
	strSQL += " order by CustomerRating ASC"		
	subquerystring="&from_=top20.aspx"
	Dim strConn=ConfigurationSettings.appSettings("conn")
	myConn  = New SqlConnection(strConn)
	myConn.Open		
	Dim myCom As SqlCommand = _
	New SqlCommand(strSQL,myConn)
	myReader = myCom.ExecuteReader()
End Sub
</script>
<HTML><HEAD><TITLE>InterShop-Online Shopping</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<META content=""  name=description>
<META content="trading software platform" name=keywords>
<META http-equiv=Pragma content=no-cache>
<LINK href="style.css" type=text/css rel=stylesheet>
<SCRIPT language=JavaScript>
        	self.defaultStatus = "Online-Shopping!";                           
</SCRIPT>
</HEAD>
<BODY bottomMargin=0 leftMargin=0 topMargin=0  rightMargin=0 marginheight="0"  marginwidth="0">
<!--#include file="top.aspx"-->
<TABLE cellSpacing=0 cellPadding=0 border=0  width="775" >
  <TBODY> 
  <TR>
    <TD vAlign=top height="843" width="160"> 
      <table width="18%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td align="center"><br>
            <table border=0 cellspacing=0 cellpadding=0>
              <tr valign=bottom align=center> 
                <td><img src="images/web-search.gif" height="19" width="155"></td>
              </tr>
              <tr valign=top align=center> 
                <td> 
                  <table border=0 width=155 cellpadding=1 cellspacing=0 bgcolor=#708090 >
                    <tr> 
                      <td width=100% > 
                        <table width=100% border=0 cellpadding=4 cellspacing=0 bgcolor=#FFFFFF>
                          <tr> 
                            <td valign=top width=8% align="left" bgcolor="#CAE2F0"> 
                              <input size=15  onFocus="this.value = '';" value="Keyword" name=txtKeyword2 class=textbox>
                              <img height=21 
            alt="Click here to search the Item." 
            src="images/go-button.gif" 
            width=21 align=absMiddle 
      border=0> <br>
                              <img src="images/powered-by-google.gif" width="95" height="14"> 
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
            </table>
      </table>
      <table width="18%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td align="center"><br>
            <table border=0 cellspacing=0 cellpadding=0>
              <tr valign=bottom align=center> 
                <td><img src="images/browse-items.gif" width="155" height="19"></td>
              </tr>
              <tr valign=top align=center> 
                <td> 
                  <table border=0 width=155 cellpadding=1 cellspacing=0 bgcolor=#708090 >
                    <tr> 
                      <td width=100% height="49"> 
                        <table width=100% border=0 cellpadding=4 cellspacing=0 bgcolor=#FFFFFF>
                          <tr> 
                            <td valign=top width=8% align="left" height="51" bgcolor="#CAE2F0"> 
                              <!--#include file="includes/listsubcategories.htm"-->
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
            </table>
      </table>
      <!--#include file="left.aspx"-->
    </TD>
    <TD class=margin width="1" valign="top" align="right" bgcolor="#666666" height="843" > 
    </TD>
    <TD class=text_normal id=mainContent vAlign=top width="425"> 
      <TABLE cellSpacing=4 cellPadding=4 width="100%" align=left border=0 height="61">
        <TR> 
          <TD vAlign=top align=left> 
            <!--#include file="submenu.aspx"-->
            <br><img src="images/top20.gif"><br>
          </TD>
        </TR>
        <TBODY> 
        <TR> 
          <TD vAlign=top align=middle height="207"> 	
              <table width="100%" border="0" 
		cellpadding="0" cellspacing="0">
	<%While myReader.Read()
	li+=1%>
              <tr> 
                  <td width="25%" valign="top">
	     <img src="books/<%=myReader("ImagePathSmall")%>" 
	      height="100"></td>
                  <td width="75%" valign="top"> <b>
	    <a href="details.aspx?itemid=
		<%=myReader("ItemID")%>&aid=
		<%=myReader("AuthID")%>
		&scid=<%=myReader("SubCateID")%>
		&sid=<%=session.SessionID%>&
		<%=subquerystring%>">
		<font face="Arial"><%=myReader("ItemName")%>
		</font></a></b><br>
                    	<b><%=myReader("AuthorName")%>
		</b><br>
                    	Đánh giá của khách hàng: 
		<img src="icons/stars<%=myReader("CustomerRating")%>.gif" 
		width="64" height="12"><br>
                    	Nhà xuất bản: <%=myReader("ProName")%><br>
                    	Giá bìa: <%=formatnumber(myReader("ListPrice"),0)%> 
		Giảm giá: <%=formatnumber(myReader("SalesDiscount"),0)%>
		<br>
                    	Giá bán: <%=formatnumber(myReader("SalesPrice"),0)%><br>
                    	Kiểu bìa: <%=myReader("ItemStyle")%> <br>
                    	<%=myReader("Available")%> <br><br></td>
                   </tr>	
		<%
		If li=3 then%>
		<tr> 
                  	<td height="19" colspan="2"> 
                    	<hr noshade size="1" color=gray><br>                    	
                    	<br>
                  	</td>
                	</tr> 
		    
	 <%
		End If
	End While
	 If li=0 then%>
	  <tr> 
                  <td height="19" colspan="2"> 
                    <hr noshade size="1" color=gray><br>
		<font size="3"><b>Items not found!.</b></font></b>		
                  </td>
                </tr> 
	<%
	End If
	myReader.Close
	myConn.Close%>
                </table>
          </TD>
        </TR>
        </TBODY> 
      </TABLE>
    </TD>
    <TD class=margin width="1" valign="top" align="right" bgcolor="#666666" height="843"> 
    </TD>
    <TD class=margin valign="top" align="center" height="843" width="160"> 
      <TABLE>
       
	<tr><td>&nbsp;</td><td valign=top>
	  <!--#include file="includes/right-next.htm" --></td></tr>
	    <tr>
          <td>&nbsp;</td>
          <td><br>
            <table width="18%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="center"> 
                  <table border=0 cellspacing=0 cellpadding=0>
                    <tr valign=bottom align=center> 
                      <td><img src="images/top-products.gif" width="155" height="19"></td>
                    </tr>
                    <tr valign=top align=center> 
                      <td> 
                        <table border=0 width=155 cellpadding=1 cellspacing=0 bgcolor=#708090 >
                          <tr> 
                            <td width=100%> 
                              <table width=100% border=0 cellpadding=4 cellspacing=0 bgcolor=#FFFFFF>
                                <tr> 
                                  <td valign=top width=8% align="left" height="52"> 
                                    <p>&nbsp;</p>
                                  </td>
                                  <td valign=top width=92% align="left" height="52"> 
                                    <!--#include file="includes/right-top.htm" -->
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                  </table>
            </table>
          </td>
        </tr>
        
      </TABLE>
    </TD>
  </TR></TBODY></TABLE>
  <!--#include file="bottom.aspx"-->
</BODY></HTML>
